<?php
 session_start();
require_once("bdd.php");

if( isset($_POST['email']) && isset($_POST['nom']) && isset($_POST['prenom']) && isset($_POST['mdp']) && isset($_POST['raison']) ) {


$text = addslashes( $_POST['raison'] );

$connexion->exec("INSERT INTO user (mail, prenom, nom, mdp, raison)
					VALUES( '".$_POST['email']."', '".$_POST['prenom']."', '".$_POST['nom']."', '".$_POST['mdp']."', '".$text."')");

				
			
					 $hostAccueil  = $_SERVER['HTTP_HOST'];
					 $url = '/contact.php?mail=1';
					header("Location: http://$hostAccueil$url");
} else {

	 $hostAccueil  = $_SERVER['HTTP_HOST'];
 header("Location: http://$hostAccueil");

}
?>